CLDSRV-873: return checksum in HeadObject and GetObject#6117
Conversation
Review by Claude Code |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files
... and 1 file with indirect coverage changes @@ Coverage Diff @@
## development/9.4 #6117 +/- ##
===================================================
- Coverage 84.76% 84.73% -0.04%
===================================================
Files 207 207
Lines 13569 13587 +18
===================================================
+ Hits 11502 11513 +11
- Misses 2067 2074 +7
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
7d130cc to
8e51413
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds end-to-end checksum handling: computing/validating checksums on incoming PUT/UploadPart streams, persisting them in object metadata, and returning checksum headers in responses (notably for HeadObject when checksum mode is enabled).
Changes:
- Add checksum parsing/validation utilities and a new
ChecksumTransformstream to compute digests while streaming uploads. - Store computed checksum data into metadata (including defaulting to CRC64NVME when no checksum is provided) and return checksum response headers for
PutObjectandHeadObject(x-amz-checksum-mode: ENABLED). - Expand unit/functional test coverage for checksum headers, trailer parsing, and rejection paths.
Reviewed changes
Copilot reviewed 26 out of 27 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| yarn.lock | Pins arsenal to a specific commit on the checksum-metadata branch. |
| package.json | Updates arsenal dependency to a git branch providing checksum metadata support. |
| lib/services.js | Persists checksum into ObjectMD and returns checksum in metadataStoreObject result. |
| lib/routes/routeBackbeat.js | Explicitly ignores computed checksum from dataStore for Backbeat data-only writes. |
| lib/auth/streamingV4/trailingChecksumTransform.js | Parses trailing checksum trailer and emits a trailer event for downstream validation. |
| lib/auth/streamingV4/ChecksumTransform.js | New transform to compute per-algorithm digests and validate expected/trailer checksums. |
| lib/api/objectPut.js | Returns x-amz-checksum-* response header when checksum is available from storage result. |
| lib/api/objectHead.js | Adds x-amz-checksum-mode validation and returns checksum headers when enabled. |
| lib/api/apiUtils/object/storeObject.js | Integrates prepareStream checksum pipeline, validates checksum post-put, and deletes data on checksum failure. |
| lib/api/apiUtils/object/prepareStream.js | Builds stream pipeline (V4 / trailing trailer parsing / checksum transform) and returns { error, stream }. |
| lib/api/apiUtils/object/createAndStoreObject.js | Adds checksum handling for zero-byte objects (computes and stores empty-body checksum). |
| lib/api/apiUtils/integrity/validateChecksums.js | Adds trailer-related checksum error types, header parsing (getChecksumDataFromHeaders), and error mapping. |
| tests/unit/auth/TrailingChecksumTransform.js | Refactors and expands trailer parsing tests; updates expectations for new error behavior. |
| tests/unit/auth/ChecksumTransform.js | New unit tests for checksum computation and trailer/non-trailer validation logic. |
| tests/unit/api/utils/metadataMockColdStorage.js | Exports baseMd for reuse in checksum-mode unit tests. |
| tests/unit/api/objectPut.js | Adds unit tests asserting checksum stored in metadata and returned in response headers. |
| tests/unit/api/objectHead.js | Adds unit tests for checksum-mode response headers across algorithms. |
| tests/unit/api/apiUtils/object/storeObject.js | New tests for dataStore() checksum validation/cleanup and callback correctness. |
| tests/unit/api/apiUtils/object/prepareStream.js | New tests validating prepareStream return shape and pipeline behavior for multiple modes. |
| tests/unit/api/apiUtils/integrity/validateChecksums.js | Adds unit tests for new header parsing and error mapping helpers. |
| tests/multipleBackend/routes/routeBackbeat.js | Adds checksum validation expectations for Backbeat data write routes. |
| tests/functional/raw-node/test/trailingChecksums.js | Updates trailing checksum digest constant in raw-node functional test. |
| tests/functional/raw-node/test/routes/routeMetadata.js | Adds end-to-end verification that checksum is stored in metadata after PutObject. |
| tests/functional/raw-node/test/checksumPutObjectUploadPart.js | New extensive raw-node functional suite covering checksum rejection and trailer scenarios. |
| tests/functional/aws-node-sdk/test/object/putVersion.js | Updates metadata comparison exclusions to include checksum. |
| tests/functional/aws-node-sdk/test/object/objectHead.js | Adds SDK-level HeadObject checksum-mode tests and CRT CRC64NVME wiring. |
| tests/functional/aws-node-sdk/test/object/mpuVersion.js | Adds workaround for MPU restore path that does not yet persist checksums. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
fea5f58 to
8f9c848
Compare
Hello leif-scality,My role is to assist you with the merge of this Available options
Available commands
Status report is not available. |
Branches have divergedThis pull request's source branch To avoid any integration risks, please re-synchronize them using one of the
Note: If you choose to rebase, you may have to ask me to rebuild |
8626736 to
8f9c848
Compare
Incorrect fix versionThe
Considering where you are trying to merge, I ignored possible hotfix versions and I expected to find:
Please check the |
|
585ee15 to
6456d26
Compare
|
6456d26 to
d9fe250
Compare
|
|
079c414 to
bdcaca2
Compare
|
LGTM |
bdcaca2 to
541bec8
Compare
|
LGTM |
541bec8 to
202d8e0
Compare
|
LGTM |
|
ping |
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
|
|
/approve |
In the queueThe changeset has received all authorizations and has been added to the The changeset will be merged in:
The following branches will NOT be impacted:
There is no action required on your side. You will be notified here once IMPORTANT Please do not attempt to modify this pull request.
If you need this pull request to be removed from the queue, please contact a The following options are set: approve |
|
I have successfully merged the changeset of this pull request
The following branches have NOT changed:
Please check the status of the associated issue CLDSRV-873. Goodbye leif-scality. |
Uh oh!
There was an error while loading. Please reload this page.